package com.doyutu.seed.utils;

import java.util.concurrent.ThreadLocalRandom;

/**
 * @author DoyuTu
 * @version 0.0.1
 * spring-boot-project-seed
 * ThreadLocalRandom随机数生成器
 */
public class RandomUtil {

    private static ThreadLocalRandom getCurrent() {
        return ThreadLocalRandom.current();
    }

    public static int nextInt() {
        return getCurrent().nextInt();
    }

    public static int nextInt(int bound) {
        return getCurrent().nextInt(bound);
    }

    public static int nextInt(int origin, int bound) {
        return getCurrent().nextInt(origin, bound);
    }

    public static boolean nextBoolean() {
        return getCurrent().nextBoolean();
    }

    public static double nextDouble() {
        return getCurrent().nextDouble();
    }

    public static double nextDouble(double bound) {
        return getCurrent().nextDouble(bound);
    }

    public static double nextDouble(double origin, double bound) {
        return getCurrent().nextDouble(origin, bound);
    }

    public static double nextGaussian() {
        return getCurrent().nextGaussian();
    }

    public static void main(String[] args) {
        System.out.println(nextInt());
    }

}
